define('/static/js/router/jobDetail', function ( require, exports, module ) {

    var JobDetailModel  = require('js/model/jobDetail')
    , JobDetailView     = require('js/view/jobDetail')
    , sCallBack = function ( model, res ) {
        new JobDetailView({ model: model.toJSON() });
    };
    
    return Backbone.Router.extend({
    
        routes: {
            'job/:id': 'job'
        },

        // www.nohr.com/#job/2
        job: function ( id ) {
            JobDetailView.waiting( id );
            new JobDetailModel().fetch({
                url     : 'job/' + id,
                success : sCallBack, 
                error   : function () {
                    JobDetailView.removeWaiting(id);
                } 
            });
        }

    });

});
